Skip to content

fix(examples): remove broken require.main guards and their importer examples - #168

Merged
ling-senpeng13 merged 1 commit into
mainfrom
fix/esm-main-guard-examples
Aug 18, 2026
Merged

fix(examples): remove broken require.main guards and their importer examples#168
ling-senpeng13 merged 1 commit into
mainfrom
fix/esm-main-guard-examples

Conversation

@ling-senpeng13

@ling-senpeng13 ling-senpeng13 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

63-deploy.ts and 63d-serve-from-package.ts guarded main() with if (require.main === module), which throws ReferenceError: require is not defined in ES module scope — crashing them on direct execution and, transitively, 63c-run-by-name.ts/63e-run-monitoring.ts which import agents from them.

Per review, rather than porting the guard to its ESM equivalent:

  • Delete 63c-run-by-name.ts and 63e-run-monitoring.ts — the only importers that made a main() guard necessary
  • Remove the guards from 63-deploy.ts and 63d-serve-from-package.ts; main() is now invoked directly like every other example
  • Update the README (production-pattern prose + catalog table)

Verified: both remaining examples run to COMPLETED against conductor-oss 3.32.0-rc18; no stale references to the deleted files remain.

@ling-senpeng13
ling-senpeng13 marked this pull request as ready for review August 17, 2026 23:35
@ling-senpeng13
ling-senpeng13 marked this pull request as draft August 18, 2026 00:25
@kowser-orkes

Copy link
Copy Markdown
Contributor

I have investigated

Delete followings

  • 63c-run-by-name.ts
  • 63e-run-monitoring.ts

For others

  • update readme
  • remove if guard for main invocation from other scripts

@ling-senpeng13 ling-senpeng13 changed the title fix(examples): replace CommonJS require.main guard with ESM equivalent fix(examples): remove broken require.main guards and their importer examples Aug 18, 2026
@ling-senpeng13

ling-senpeng13 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Done in b4231bc — deleted 63c-run-by-name.ts and 63e-run-monitoring.ts, removed the main() guards from 63-deploy.ts/63d-serve-from-package.ts (now invoked directly like every other example), and updated the README references. All three remaining 63-family examples verified running to COMPLETED against conductor-oss 3.32.0-rc18. (Branch squashed to a single commit.)

@ling-senpeng13
ling-senpeng13 marked this pull request as ready for review August 18, 2026 21:58

@kowser-orkes kowser-orkes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…xamples

63-deploy.ts and 63d-serve-from-package.ts guarded main() with
'require.main === module', which throws ReferenceError in ES module
scope — crashing them on direct execution and, transitively, the
examples importing agents from them.

Delete 63c-run-by-name.ts and 63e-run-monitoring.ts (the only importers
that made a main() guard necessary), invoke main() directly like every
other example, and update the README references.
@ling-senpeng13
ling-senpeng13 force-pushed the fix/esm-main-guard-examples branch from eb9d75e to b4231bc Compare August 18, 2026 22:21
@ling-senpeng13
ling-senpeng13 merged commit 208a5a0 into main Aug 18, 2026
24 of 27 checks passed
@ling-senpeng13
ling-senpeng13 deleted the fix/esm-main-guard-examples branch August 18, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants